package com.itqf.config;

import org.springframework.amqp.core.*;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * @Description: 构建exchange  queue  bingdings  routing-key
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/12/18
 * @Time: 下午3:36
 */
//@Configuration
@SpringBootConfiguration  //<beans>
public class RabbitMQConfig {

    @Bean
    public FanoutExchange getFanoutExchange() {
        return new FanoutExchange("boot-fanout-exchange", true, false);//String name, boolean durable, boolean autoDelete
    }

//    @Bean
//    public DirectExchange getDirectExchange() {
//        return new DirectExchange("boot-direct-exchange", true, false);//String name, boolean durable, boolean autoDelete
//    }
//
//    @Bean
//    public TopicExchange getTopicExchange() {
//        return new TopicExchange("boot-topic-exchange", true, false);//String name, boolean durable, boolean autoDelete
//    }
//
//    @Bean
//    public Queue queue() {
//        //String name, boolean durable, boolean exclusive, boolean autoDelete
//        return new Queue("queue", true, false, false
//        );
//    }
//
//    @Bean
//    public Binding binding(FanoutExchange fanoutExchange, Queue queue) {
//        return BindingBuilder.bind(queue).to(fanoutExchange);
//        //如果exchange是direct|topic  那么需要.with("*.info");;
//    }


}
